package com.sixth.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixth.entity.TbMember;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;
@Component
public interface TbMemberDao extends BaseMapper<TbMember> {
    int deleteByPrimaryKey(String id);

    int insert(TbMember record);

    int insertSelective(TbMember record);

    TbMember selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(TbMember record);

    int updateByPrimaryKey(TbMember record);

    List<TbMember> getStudentAll(@Param("mobile") String mobile, @Param("nickname") String nickname, @Param("startTime")String startTime, @Param("stopTime")String stopTime,@Param("isDisabled")String isDisabled
    );
    @Update("update tb_member set is_disabled=#{state} where id=#{id}")
    int stateChange(String state, String id);
    @Update("update tb_member set nickname=#{nickname},sex=#{sex},remark=#{remark} where id=#{id}")
    int updateInfo(@Param("id") String id, @Param("nickname") String nickname, @Param("sex") Byte sex, @Param("remark") String remark);
    @Insert("insert into tb_member (id,mobile,password,is_type,is_disabled,is_deleted,gmt_create,gmt_modified)values(#{id},#{mobile},#{encode},#{type},#{disabled},#{deleted},#{date},#{date})")
    int insertMy(@Param("id") String orderNo,@Param("mobile") String mobile,@Param("encode")String encode,@Param("type")String type,@Param("disabled")Boolean disabled,@Param("deleted")Boolean deleted,@Param("date") Date date);
    int updateInfo(@Param("id") String id, @Param("nickname") String nickname, @Param("sex") String sex, @Param("remark") String remark,@Param("age")String age,@Param("avatar")String avatar);
}